//
//  YZDetailCell.m
//  ZhuKuang
//
//  Created by mafy on 17/7/11.
//  Copyright © 2017年 jjkj. All rights reserved.
//

#import "YZDetailCell.h"

@implementation YZDetailCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.contentLabel];
        
        [self setSubViewsFrame];
    }
    
    return self;
}

#pragma mark - 布局
- (void)setSubViewsFrame{
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.mas_equalTo(self.contentView.mas_left);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.width.mas_equalTo(@88);
    }];
    
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(self.contentView.mas_right);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.left.mas_equalTo(self.titleLabel.mas_right);
        make.right.mas_equalTo(self.contentView.mas_right);
    }];
}

#pragma mark - 懒加载
- (UILabel *)contentLabel{
    
    if (!_contentLabel) {
        
        _contentLabel = [[UILabel alloc]init];
        _contentLabel.text = @"内容";
        _contentLabel.font = [UIFont systemFontOfSize:16.0f];
        _contentLabel.textColor = COLOR(25, 158, 216, 1);
        _contentLabel.textAlignment = NSTextAlignmentRight;
    }
    
    return _contentLabel;
}

#pragma mark - 懒加载
- (UILabel *)titleLabel{
    
    if (!_titleLabel) {
        
        _titleLabel = [[UILabel alloc]init];
        _titleLabel.text = @"名称";
        _titleLabel.font = [UIFont systemFontOfSize:16.0f];
        _titleLabel.textColor = COLOR(25, 158, 216, 1);
        _titleLabel.textAlignment = NSTextAlignmentLeft;
    }
    
    return _titleLabel;
}

@end
